package com.cec.controller.user;


import com.cec.dto.InfoDTO;
import com.cec.result.Result;
import com.cec.service.user.UserInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 资讯表 前端控制器
 * </p>
 *
 * @author lt
 * @since 2024-10-25
 */
@Slf4j
@RestController("userInfoController")
@Api(tags = "资讯信息")
@RequestMapping("/user/info")
public class UserInfoController {

    @Autowired
    private UserInfoService userInfoService;

    @GetMapping
    @ApiOperation("分页查询消息信息")
    public Result pageQueryInfo(InfoDTO infoDTO){
        return userInfoService.pageQueryInfo(infoDTO);
    }

    @GetMapping("/type")
    @ApiOperation("资讯类型")
    public Result queryInfoType(){
        return userInfoService.queryInfoType();
    }

    @GetMapping("/{id}")
    @ApiOperation("通过id查询资讯信息")
    public  Result queryInfoById(@PathVariable Integer id){
        return userInfoService.queryInfoById(id);
    }

}

